package lc.animation;

import com.jme.scene.Controller;
import com.jme.scene.Node;

public class AnimationController extends Controller {

	private static final long serialVersionUID = 1L;

	@Override
	public void update(float time) {
		if (instance != null) {
			instance.advance(time);
			instance.updateTarget();
		}
	}

	AnimationController() throws Exception {
		throw new Exception("AnimationController only supports manual instantiation");
	}

	AnimationInstance instance;

	public AnimationController(Node target, Animation a) {
		instance = new AnimationInstance(target, a, true);
	}
}
